using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IBS.Bll.BillService
{
    internal class BillDataAccess
    {
        enum Services
        {
            CosmosTV,
            VG
        }
        private static string GetRandomServiceName()
        {
            var random = new Random();
            var service = (Services)(random.Next(1, 2));
            return service.ToString();
        }
        internal static Bill GetAllBills(string userName, DateTime fromDate, DateTime toDate)
        {

            var payments = Enumerable.Range(1, 10)
                .Select(
                i => new Payment
                {
                    AccountNumber = i.ToString(),
                    Amount = i * 10,
                    Date = DateTime.Now.AddDays(i),
                    OperationName = "Payment",
                    ServiceName = GetRandomServiceName()
                });
            var bill = new Bill()
            {
                Payments = payments.ToList(),
                AccountNumber = "xxx-xxxx",
                BankName = "IBS",
                BillNumber = 123,
                FromDate = fromDate,
                ToDate = toDate,
                ResultBalance = 12345,
                CurrentDate = DateTime.Now
            };
            return bill;
        }
    }
}
